#! /usr/bin/env node

const {program} = require('commander');
const list = require('./command/list')
const add = require('./command/add')
const {del} = require('./command/task')
const login = require('./command/login')
const markDone = require('./command/markDone')
const {list: moduleList} = require('./command/module')
const wifi = require('./command/wifi')
const zhihu = require('./command/zhihu')

program
  .command('list [tag]')
  .option('-d, --done', 'all done task')
  .description('List all the TODO tasks')
  .action(list)

program
  .command('add <task>')
  .option('-s, --start <startTime>', 'Task start time')
  .description('Add a new TODO task')
  .action(add)

program
  .command('d <task>')
  .description('Del a TODO Task')
  .action(del)

program
  .command('wifi [wifiName]')
  .description('print wifi password')
  .action(wifi)

program
  .command('done <task>')
  .description('Mark commands done')
  .action(markDone)

program
  .command('modules')
  .alias('mods')
  .description('task module')
  .option('-t, --task <task>', 'The tasks to mark done. If not specified, all tasks will be marked done.')
  .action(moduleList)

program
  .command('login <token>')
  .description('login by token')
  .action(login)

program
  .command('zhihu <username>')
  .description('zhihu search')
  .action(zhihu)


program.parse();
